﻿using Aliphant.Mvvm.XEvent.Interface;
using Aliphant.Mvvm.XEvent.Ioc;
using System.Windows;

namespace Aliphant.Mvvm.XEvent
{
    public abstract class XApplicationBase : Application
    {
        private IXContainer? _container;

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            InitializeInternal();
        }

        private void InitializeInternal()
        {
            Initialize();
        }

        private void Initialize()
        {
            _container = XContainerLocator.Instance;
            RegisterTypes(_container);
        }

        public abstract void RegisterTypes(IXContainer container);
    }
}
